package HTTPget;

import java.io.IOException;

import Body.task;
import jxl.read.biff.BiffException;
import jxl.write.WriteException;

public class Callback  {
	public static int  liveTask=0;
	public static int failTask=0;
	public static Object lock1=new Object();
	public static Object lock2=new Object();
	public static task task= new task();
	public static void finish(){
		synchronized (lock1) {
		liveTask--;
		if (liveTask==0)
			try {
				dataSave.SaveInExcel();
				task.run();
			} catch (BiffException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (WriteException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	public static void newFail(){
		synchronized (lock2) {
			failTask++;
		}
	}
	
}
